home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / Documents / JAVA Programming / examples / 16 / ButtonDemo.java < prev    next >
Encoding:
Java Source  |  2000-09-08  |  592 b   |  21 lines

  1. /* <applet code = "ButtonDemo" width=100 height=100>
  2.    </applet>
  3. */ 
  4. import java.awt.*;
  5. import java.applet.*;
  6. public class ButtonDemo extends Applet {
  7. public void init() {
  8. setLayout(null);
  9. int width = Integer.parseInt(getParameter("width"));
  10. int height = Integer.parseInt(getParameter("height"));
  11. Button yes = new Button("Yes");
  12. Button no = new Button("No");
  13. Button maybe = new Button("Undecided");
  14. add(yes);
  15. add(no);
  16. add(maybe);
  17. yes.reshape(0, 0, width, height / 3);
  18. no.reshape(0, height / 3, width, height / 3);
  19. maybe.reshape(0, 2 * height / 3, width, height / 3);
  20. } }
  21.